//
//  PannelViewController.m
//  Butler
//
//  Created by liaozhenming on 16/6/12.
//  Copyright © 2016年 liaozhenming. All rights reserved.
//

#import "PannelViewController.h"
#import "KKPageView.h"

#import "OrderViewController.h"
#import "KKCustomerEditView.h"
#import "KKGoodsEditView.h"
#import "KKEmployeeEditView.h"

@interface PannelViewController ()

@property (nonatomic, weak) IBOutlet KKPageView *pageView;
@property (nonatomic, strong) UIView *bottomView;

@property (nonatomic, strong) KKCustomerEditView *customerEditView;
@property (nonatomic, strong) KKGoodsEditView *goodsEditView;
@property (nonatomic, strong) KKEmployeeEditView *employeeEditView;

@end

@implementation PannelViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _customerEditView = [[KKCustomerEditView alloc] init];
    _goodsEditView = [[KKGoodsEditView alloc] init];
    _employeeEditView = [[KKEmployeeEditView alloc] init];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Action methods

- (IBAction)action_back:(id)sender {
    
    [self.navigationController popViewControllerAnimated: YES];
}

- (IBAction)action_order:(id)sender {
    
    switch (_segmentedControl.selectedSegmentIndex) {
        case 0:
        {
            [_customerEditView kk_show];
        }
            break;
        case 1:
        {
            [_goodsEditView kk_show];
        }
            break;
        case 2:
        {
            [_employeeEditView kk_show];
        }
            break;
    }
}

- (IBAction)action_segmented:(UISegmentedControl*)sender {
    
    switch (sender.selectedSegmentIndex) {
        case 0:
        {
            
            [_pageView setPageViewCellType: 0];
        }
            break;
        case 1:
        {
            
            [_pageView setPageViewCellType: 1];
        }
            break;
        case 2:
        {
            
            [_pageView setPageViewCellType: 2];
        }
            break;
    }
}

@end
